home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / source.exe / POSIX / SH / STD / H / SYS / WAIT.H < prev   
C/C++ Source or Header  |  1992-07-13  |  1KB  |  42 lines

  1. /*
  2.  * POSIX <sys/wait.h>
  3.  */
  4. #if __STDC__
  5. #define    ARGS(args)    args
  6. #else
  7. #define    ARGS(args)    ()
  8. #endif
  9.  
  10. #ifndef sparc
  11. typedef int pid_t;        /* belong in sys/types.h */
  12. #endif
  13.  
  14. #ifdef sparc
  15. # include "/usr/include/sys/wait.h"
  16. #else
  17.  
  18. /* waitpid options */
  19. #define WNOHANG        1    /* don't hang in wait */
  20. #define WUNTRACED    2    /* tell about stopped, untraced children */
  21.  
  22. #define    WSTOPPED    0x7F    /* process is stopped */
  23.  
  24. #define WIFSTOPPED(x)    (((x)&0xFF) == 0x7F)
  25. #define WIFSIGNALED(x)    (((x)&0xFF) != 0x7F && ((x)&0x7F) != 0)
  26. #define WIFEXITED(x)    (((x)&0xFF) != 0x7F && ((x)&0x7F) == 0)
  27. #define    WIFCORED(x)    (!!((x)&0x80)) /* non-standard */
  28. #define    WEXITSTATUS(x)    ((x)>>8&0xFF)
  29. #define    WTERMSIG(x)    ((x)&0x7F)
  30. #define    WSTOPSIG(x)    ((x)>>8&0xFF)
  31.  
  32. pid_t wait ARGS((int *statp));
  33. #if _BSD
  34. pid_t wait3 ARGS((int *statp, int options, Void *));
  35. /* todo: does not emulate pid argument */
  36. #define    waitpid(pid, sp, opts)    wait3(sp, opts, (Void*)NULL)
  37. #else
  38. pid_t waitpid ARGS((pid_t pid, int *statp, int options));
  39. #endif
  40.  
  41. #endif /* sparc */
  42.